import 'package:flutter/material.dart';

class NavigationCard extends StatelessWidget {
  final IconData icon;
  final String title;
  final String subtitle;
  final Color? color;
  final VoidCallback onTap;

  const NavigationCard({
    super.key,
    required this.icon,
    required this.title,
    required this.subtitle,
    this.color,
    required this.onTap,
  });

  @override
  Widget build(BuildContext context) {
    return Card(
      elevation: 2,
      margin:  const EdgeInsets.only(bottom: 16),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(12),
      ),
      child: InkWell(
        onTap: onTap,
        borderRadius: BorderRadius.circular(12),
        child: Padding(
          padding: const EdgeInsets.all(16.0),
          child: Row(
            children: [
              Container(
                padding: const EdgeInsets.all(12),
                decoration: BoxDecoration(
                  color: color?.withOpacity(0.2)??Colors.blue.withOpacity(0.2),
                  borderRadius: BorderRadius.circular(10),
                ),
                child: Icon(icon,size: 28, color: color ?? Colors.blue),
              ),
              const SizedBox(width: 16),
              Expanded(
                  child: Column(
                    crossAxisAlignment:  CrossAxisAlignment.start,
                    children: [
                      Text(title,
                        style: TextStyle(fontSize: 18,
                            fontWeight: FontWeight.bold,
                            color: color ?? Colors.blue),
                      ),
                      const SizedBox(height: 4),
                      Text(subtitle,
                        style:const TextStyle(
                          fontSize: 14,
                            color:Colors.grey
                        ),),
                    ],
                  )),
              const Icon(Icons.arrow_forward_ios,size: 16,color: Colors.grey),
            ],
          ),
        ),
      ),
    );
  }
}
